Socket
Socket
Sign inDemoInstall

gulp-file

Package Overview
Dependencies
18
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gulp-file

Create vinyl files from a string or buffer and insert into the Gulp pipeline.


Version published
Weekly downloads
20K
increased by7.79%
Maintainers
3
Install size
370 kB
Created
Weekly downloads
 

Readme

Source

gulp-file

Build Status NPM version

Create vinyl files from a string or buffer and insert into the Gulp pipeline.

Installation

npm install gulp-file

API

plugin(name, source, options)

Creates a vinyl file with the given name from source string or buffer and returns a transform stream for use in your gulp pipeline.

plugin(sourceArray, options)

Creates vinyl files for each entry in the array. Each entry is an object with a name and source property. A vinyl file is created with the given name and source and inserted into the returned transform stream.

Example

Primus outputs the client library as a string. Using gulp-file we can create a vinyl file from the string and insert it into the gulp pipeline:

var gulp = require('gulp')
  , file = require('gulp-file');

gulp.task('js', function() {
  var str = primus.library();

  return gulp.src('scripts/**.js')
    .pipe(file('primus.js', str))
    .pipe(gulp.dest('dist'));
});

Use it at the beginning of your pipeline by setting src: true:

var gulp = require('gulp')
  , file = require('gulp-file');

gulp.task('js', function() {
  var str = primus.library();

  return file('primus.js', str, { src: true })
    .pipe(gulp.dest('dist'));
});

Options

src

Calls stream.end() to be used at the beginning of your pipeline in place of gulp.src(). Default: false.

BSD Licensed

Keywords

FAQs

Last updated on 02 Jan 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc